<template>
  <div>
    <h2>父组件</h2>
    <h3>{{ car }}</h3>
    <h4 v-if="ori_toy">子给的玩具: {{ ori_toy }}</h4>
    <Child :car="car" :sendToy="getToy" />
  </div>
</template>

<script setup lang="ts" name="Props">
import Child from './child.vue'
import { ref } from 'vue'

let car = ref('奔驰')
let ori_toy = ref('')
const getToy = (val:string) => {
  console.log('父组件收到了玩具', val)
  ori_toy.value = val
  console.log(ori_toy)
}

</script>

<style scoped>

</style>